<template>
  <view class="iscontainer">
    <image src="../../assets/images/index/submit_success.png" class="img" mode="scaleToFill"></image>
    <view class="title">恭喜您，提交成功</view>
    <view class="text" v-if="info.sendType=='1'">
      <p>请于 {{info.receiveTime.replace('~~','~')}}</p>
      <p>到网点领取！</p>
    </view>
    <view class="text" v-else-if="info.sendType=='2'">
      <view>7个工作日会寄送到指定的地址</view>
      <view>请注意查收！</view>
    </view>
    <view class="text" v-else-if="info.sendType=='3'">
      <view>5个工作日会发送至指定的邮箱</view>
      <view>请注意查收！</view>
    </view>
    <view class="bluebtn" @click="goon">继续开票</view>
    <view class="whitebtn" @click="gohome">返回首页</view>
  </view>
</template>

<script setup lang="ts">
import {ref} from 'vue';
import Taro, {useDidShow,useRouter} from "@tarojs/taro";
import {$post} from "@/@api";
import useUserInfoStore from "@/store/user";
const userStore = useUserInfoStore()

const info = ref<any>({
  sendType: useRouter().params.sendType || '',
  receiveTime: useRouter().params.receiveTime || '',
})


const goon = ()=>{
  Taro.navigateTo({
    url: '/pages/invoicing/index'
  })
}

const gohome = ()=>{
  Taro.reLaunch({
    url: '/pages/index/index'
  })
}

const getInfo = async()=>{
  const res: any = await $post(
      '/selfmachine-system/ssInvoice/invoiceDetails',
      {
        customerCode: userStore.userInfo.customerCode,
        ssiId: useRouter().params.ssiId,
      }
  )
  info.value = res.data || {}
}

getInfo()

</script>

<style lang="scss" >
// @import "xxx";
// @import url(xxx);
page {
  background-color: #fff;
}
.iscontainer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  .img {
    margin-top: 112rpx;
    width: 280rpx;
    height: 280rpx;
  }
  .title {
    margin-top: 32rpx;
    font-size: 40rpx;
    line-height: 56rpx;
    font-weight: 500;
    color: #252525;
  }
  .text {
    margin-top: 12rpx;
    line-height: 40rpx;
    font-size: 28rpx;
    color: #999;
    text-align: center;
  }
  .bluebtn {
    margin-top: 56rpx;
    width: 590rpx;
    height: 88rpx;
    border-radius: 44rpx;
    box-sizing: border-box;
    background-color: #0966ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 32rpx;
  }
  .whitebtn {
    margin-top: 32rpx;
    width: 590rpx;
    height: 88rpx;
    border-radius: 44rpx;
    box-sizing: border-box;
    background-color: #fff;
    border: 1rpx solid #c4c4c4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #252525;
    font-size: 32rpx;
  }
}

</style>
